import time

def b_s(n):
    sw = True
    while sw:
        sw=False
        for i in range(len(n) - 1):
            if nums[i] > nums[i+1]:
                nums[i], nums[i+1] = nums[i+1], nums[i]
                sw = True

def r2list(filename):
    file = open(filename, 'r')
    data = file.readlist ()
    return data

m1 = r2list("m1_sorted.txt")
m2 = r2list("m2_reverse.txt")
m3 = r2list("m3_shuffle.txt")

t_start = time.time()
b_s(m1)
t_finish = time.time()
print("m1_sorted.txt", round((t_finish - t_start) * 1000), "milisecond")

t_start = time.time()
b_s(m2)
t_finish = time.time()
print("m2_reverse.txt", round((t_finish - t_start) * 1000), "milisecond")

t_start = time.time()
b_s(m3)
t_finish = time.time()
print("m3_shuffle.txt", round((t_finish - t_start) * 1000), "milisecond")

